package org.classg.order.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${weixin.pay.appid}")
    private String appid;
    @Value("${weixin.pay.partner}")
    private String partner;
    @Value("${weixin.pay.partnerkey}")
    private String partnerKey;
    @Value("${weixin.pay.notifyurl}")
    private String notifyUrl;

    public static String WEIXIN_PAY_APP_ID;
    public static String WEIXIN_PAY_PARTNET;
    public static String WEIXIN_PAY_PARTNER_KEY;
    public static String WEIXIN_PAY_NOTIFY_URL;


    @Override
    public void afterPropertiesSet() throws Exception {
        WEIXIN_PAY_APP_ID = appid;
        WEIXIN_PAY_PARTNET = partner;
        WEIXIN_PAY_PARTNER_KEY = partnerKey;
        WEIXIN_PAY_NOTIFY_URL = notifyUrl;
    }
}
